1. Field of the Invention
The present invention relates to a nonvolatile semiconductor memory device, and particularly to a nonvolatile semiconductor memory device using a block erase type nonvolatile memory.
2. Description of the Background Art
A nonvolatile semiconductor memory device using a block erase type nonvolatile memory such as the flash memory having a finite number of erase operations is characterized by the fact that it withstands a greater physical shock and consumes less power compared with a magnetic memory device such as the hard disk drive. However, such a nonvolatile semiconductor memory device has a high cost per bit and the number of times data is rewritten therein is limited to a maximum of several hundreds of thousands. The nonvolatile semiconductor memory device utilizing the block erase type nonvolatile memory is thus employed as a memory device for a portable computer that can easily be carried or as a film for an digital camera.
Most of host systems in such portable computers and digital cameras use a file system of FAT (File Allocation Table) type for keeping and managing data with a high compatibility. According to the FAT type file system, the internal portion of the memory device is divided into sections of a certain size, for example, sectors or clusters consisting of several sectors (each of the sections is hereinafter referred to as "erase block"), and numbers are given respectively to the blocks to be managed. The numbers are collected in a table referred to as FAT and stored in a specific region within the memory device. FAT is always referred to each time data is read/written, and if any change is made to the data, FAT is also changed. FAT is concentratively managed in the specific region of the memory device. Therefore, considering the entire semiconductor memory device, erase and write operations are more frequently done in an erase block utilized for keeping FAT, compared with an erase block which stores general purpose data such as an application. If the memory device continues its operation in this state, the number of times erasure is done exceeds the upper limit only in the erase block which manages FAT. Any scheme is thus required for solving this problem.
An approach to solve this problem is to replace data in an erase block where rewrite is frequently performed with data in an erase block where rewrite is rarely performed, each time erasure has been done a certain number of times that does not exceed the upper limit (the number of times the erase operation is performed is hereinafter referred to as "erase number"). According to a scheme disclosed in U.S. Pat. No. 5,388,083, the erase number of an erase block is stored and when the erase number of any erase block exceeds a predetermined number, data in that erase block is replaced with data in another erase block having the minimum erase number at this time. Accordingly, this procedure is repeated until all erase blocks have the same erase number. This scheme enables the erase number to be leveled and thus all erase blocks can be erased evenly.
In such a leveling scheme, (1) it is required to recognize among all of the erase blocks an erase block having the minimum erase number, and (2) the leveling process would be continued until the erasure is done the same number of times in all erase blocks even if the difference in erase number is a few. The feature (1) leads to complexity of the processing in the semiconductor memory device and the feature (2) could lead to decrease in lifetime of the semiconductor memory device.